package com.letfox.ad.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.letfox.ad.service.UDMStatisticService;
import com.letfox.statistical.model.UDMDeviceStatistic;
import com.letfox.statistical.model.UDMGeoStatistic;
import com.letfox.statistical.model.UDMMediaStatistic;
import com.letfox.statistical.service.DeviceStatisticService;
import com.letfox.statistical.service.GeoStatisticService;
import com.letfox.statistical.service.MediaStatisticService;
@Service
public class UDMStatisticServiceImpl implements UDMStatisticService {
	
	@Autowired
	private DeviceStatisticService deviceStatisticService;
	@Autowired
	private MediaStatisticService mediaStatisticService;
	@Autowired
	private GeoStatisticService geoStatisticService;

	@Override
	public List<UDMDeviceStatistic> getDeviceList(String adPutintoId,String device
			,String startTime,String endTime) throws Exception {
		List<UDMDeviceStatistic> getDeviceList=null;
		Map<String, Object> map=new HashMap<String, Object>();
		map.put("adPutintoId", adPutintoId);
		map.put("device", device);
		map.put("startTime", startTime);
		map.put("endTime", endTime);
		getDeviceList=deviceStatisticService.getList(map);
		return getDeviceList;
	}

	@Override
	public List<UDMMediaStatistic> getMediaList(String adPutintoId,
			String media, String startTime, String endTime) throws Exception {
		List<UDMMediaStatistic> getMediaList=null;
		Map<String, Object> map=new HashMap<String, Object>();
		map.put("adPutintoId", adPutintoId);
		map.put("media", media);
		map.put("startTime", startTime);
		map.put("endTime", endTime);
		getMediaList=mediaStatisticService.getList(map);
		return getMediaList;
	}

	@Override
	public List<UDMGeoStatistic> getGeoList(String adPutintoId, String geo,
			String startTime, String endTime) {
		List<UDMGeoStatistic> getGeoList=null;
		Map<String, Object> map=new HashMap<String, Object>();
		map.put("adPutintoId", adPutintoId);
		map.put("geoName", geo);
		map.put("startTime", startTime);
		map.put("endTime", endTime);
		getGeoList=geoStatisticService.getList(map);
		return getGeoList;
	}

}
